*Survey data analysis for "Media Coverage of the Senate Filibuster and Its Effects on Public Opinion"


use "FBsurvey.dta", clear

**generating variables from original survey variables

gen age=2022-birthyr
label var age "Age"

gen female=1 if gender==2
replace female=0 if gender==1
label var female "Female"

gen nonwhite=1 if race~=1
replace nonwhite=0 if race==1
label var nonwhite "Nonwhite"

gen party3=.
replace party3=1 if pid7<4
replace party3=2 if pid7==4
replace party3=2 if pid7==8
replace party3=3 if pid7>4 & pid7<8
label var party3 "Party from pid7"
label define party 1 "Democrat" 2 "Indep/DK" 3 "Republican"
label values party3 party

gen dem=.
replace dem=1 if pid7<4
replace dem=0 if pid7>3
label var dem "Democrat from pid7"

gen gop=.
replace gop=1 if pid7>4 & pid7<8
replace gop=0 if pid7<5
replace gop=0 if pid7==8
label var gop "Republican from pid7"

gen indep=.
replace indep=1 if pid7==4
replace indep=1 if pid7==8
replace indep=0 if pid7<4
replace indep=0 if pid7>4 & pid7<8
label var indep "Indep from pid7"

gen polint_wdk=.
replace polint_wdk=1 if newsint==7
replace polint_wdk=1 if newsint==4
replace polint_wdk=2 if newsint==3
replace polint_wdk=3 if newsint==2
replace polint_wdk=4 if newsint==1
label var polint_wdk "Political interest w/DK"

gen posths=0
replace posths=1 if educ>2
label variable posths "Post-HS Educ"

gen congapp4=.
replace congapp4=4 if Q56==1
replace congapp4=3 if Q56==2
replace congapp4=2 if Q56==4
replace congapp4=1 if Q56==5
label variable congapp4 "Congress Approval, 4-point (no DK)"
label define congapp4 1 "Strongly Disapprove" 2 "Disapprove" 3 "Approve" 4 "Strongly approve"
label values congapp4 congapp4


gen policyapp=.
replace policyapp=1 if Q21==4
replace policyapp=2 if Q21==3
replace policyapp=3 if Q21==2
replace policyapp=4 if Q21==1
label var policyapp "Approval of Policy"
label define policy 1 "Strongly Disapprove" 2 "Disapprove" 3 "Approve" 4 "Strongly approve"
label values policyapp policy

gen responsb=.
replace responsb=1 if Q22==1
replace responsb=2 if Q22==3
replace responsb=3 if Q22==2
label variable responsb "Responsibility for failure"
label define responsibility 1 "Democrats" 2 "Both parties equally" 3 "Republicans"
label values responsb responsibility

gen fairness=.
replace fairness=1 if Q23==4
replace fairness=2 if Q23==3
replace fairness=3 if Q23==2
replace fairness=4 if Q23==1
label var fairness "Fairness of process"
label define fairness 1 "Very unfair" 2 "Unfair" 3 "Fair" 4 "Very fair"
label values fairness fairness

gen treat=Q2123_treat
label var treat "Treatment"
label define treat 1 "Control" 2 "General Condition" 3 "Specific Condition"
label values treat treat

gen control=0
replace control=1 if treat==1
label var control "Control Group"

gen general=0
replace general=1 if treat==2
label var general "General Condition"

gen specific=0
replace specific=1 if treat==3
label var specific "Specific Condition"

gen respGOP=.
replace respGOP=1 if Q22==2
replace respGOP=0 if Q22==1
replace respGOP=0 if Q22==3
label variable respGOP "GOP responsible"

gen congapp_dum=0 if Q56>3
replace congapp_dum=1 if Q56<3
label var congapp_dum "Approve of Congress"

gen policyapp_dum=0 if Q21>2
replace policyapp_dum=1 if Q21<3
label var policyapp_dum "Approve of Policy"

gen fairness_dum=0 if Q23>2 & Q23<8
replace fairness_dum=1 if Q23<3
label var fairness_dum "Process is fair"

gen ideo=ideo5
recode ideo (6=3)
label var ideo "Ideo5 w/NS=mod"


*Section 5.1 (Policy support)

*bivariate significance

ttest policyapp if treat<3, by(general)
ttest policyapp if treat~=2, by(specific)

ttest policyapp if treat<3 & dem==1, by(general)
ttest policyapp if treat~=2 & dem==1, by(specific)

ttest policyapp if treat<3 & gop==1, by(general)
ttest policyapp if treat~=2 & gop==1, by(specific)

ttest policyapp if treat<3 & indep==1, by(general)
ttest policyapp if treat~=2 & indep==1, by(specific)

prtest policyapp_dum if treat<3, by(general)
prtest policyapp_dum if treat~=2, by(specific)

prtest policyapp_dum if treat<3 & dem==1, by(general)
prtest policyapp_dum if treat~=2 & dem==1, by(specific)

prtest policyapp_dum if treat<3 & gop==1, by(general)
prtest policyapp_dum if treat~=2 & gop==1, by(specific)

prtest policyapp_dum if treat<3 & indep==1, by(general)
prtest policyapp_dum if treat~=2 & indep==1, by(specific)

*Figure 4 

cibar policyapp, over(treat) graphopts(scheme(plotplain) title("All Respondents", size(small)) ytitle("Mean Policy Approval", size(small)) yscale(range(2 3.6)) ylabel(2(0.2)3.6)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "policy_cibar.gph"
cibar policyapp if dem==1, over(treat) graphopts(scheme(plotplain) title("Democrats", size(small)) ytitle("Mean Policy Approval", size(small)) yscale(range(2 3.6)) ylabel(2(0.2)3.6)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "policyD_cibar.gph"
cibar policyapp if gop==1, over(treat) graphopts(scheme(plotplain) title("Republicans", size(small)) ytitle("Mean Policy Approval", size(small)) yscale(range(2 3.6)) ylabel(2(0.2)3.6)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "policyR_cibar.gph"
cibar policyapp if indep==1, over(treat) graphopts(scheme(plotplain) title("Independents", size(small)) ytitle("Mean Policy Approval", size(small)) yscale(range(2 3.6)) ylabel(2(0.2)3.6)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "policyI_cibar.gph"
grc1leg "policy_cibar.gph" "policyD_cibar.gph" "policyR_cibar.gph" "policyI_cibar.gph", scheme(plotplain) note("95% confidence intervals", size(vsmall))
graph save "Graph" "policy_cibar_combine.gph"

*Figure 5

cibar policyapp_dum, over(treat) graphopts(scheme(plotplain) title("All Respondents", size(small)) ytitle("Proportion Approving", size(small)) yscale(range(.3 1)) ylabel(.3(.1)1)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "policydum_cibar.gph"
cibar policyapp_dum if dem==1, over(treat) graphopts(scheme(plotplain) title("Democrats", size(small)) ytitle("Proportion Approving", size(small)) yscale(range(.3 1)) ylabel(.3(.1)1)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "policydumD_cibar.gph"
cibar policyapp_dum if gop==1, over(treat) graphopts(scheme(plotplain) title("Republicans", size(small)) ytitle("Proportion Approving", size(small)) yscale(range(.3 1)) ylabel(.3(.1)1)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "policydumR_cibar.gph"
cibar policyapp_dum if indep==1, over(treat) graphopts(scheme(plotplain) title("Independents", size(small)) ytitle("Proportion Approving", size(small)) yscale(range(.3 1)) ylabel(.3(.1)1)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "policydumI_cibar.gph"
grc1leg "policydum_cibar.gph" "policydumD_cibar.gph" "policydumR_cibar.gph" "policydumI_cibar.gph", scheme(plotplain) note("95% confidence intervals", size(vsmall))
graph save "Graph" "policydum_cibar_combine.gph"

*Table 3

regress policyapp general specific dem gop age polint_wdk posths female nonwhite ideo
regress policyapp general specific age polint_wdk posths female nonwhite ideo if gop==1
regress policyapp general specific age polint_wdk posths female nonwhite ideo if indep==1

logit policyapp_dum general specific dem gop age polint_wdk posths female nonwhite ideo
logit policyapp_dum general specific age polint_wdk posths female nonwhite ideo if gop==1
logit policyapp_dum general specific age polint_wdk posths female nonwhite ideo if indep==1

logit policyapp_dum general specific age polint_wdk posths female nonwhite ideo if gop==1
margins, at(specific=0 age=59 polint_wdk=4 posths=1 female=1 nonwhite=0 ideo=4)
margins, at(specific=1 age=59 polint_wdk=4 posths=1 female=1 nonwhite=0 ideo=4)

*Figure 6

label variable posths "Post HS"
label variable polint_wdk "Political interest"
label variable ideo "Ideology"
logit policyapp_dum general specific dem gop age polint_wdk posths female nonwhite ideo
margins, dydx(*) post
estimates store All
logit policyapp_dum general specific age polint_wdk posths female nonwhite ideo if gop==1
margins, dydx(*) post
estimates store GOP
logit policyapp_dum general specific age polint_wdk posths female nonwhite ideo if indep==1
margins, dydx(*) post
estimates store Indep
coefplot All GOP Indep, drop(_cons dem gop age nonwhite) xline(0)  title("Logit model", size(small)) xtitle("Marginal change in prob.", size(small)) scheme(plotplain) levels(95 90)
graph save "Graph" "plot_policylogits.gph", replace

regress policyapp general specific dem gop age polint_wdk posths female nonwhite ideo
estimates store All
regress policyapp general specific age polint_wdk posths female nonwhite ideo if gop==1
estimates store GOP
regress policyapp general specific age polint_wdk posths female nonwhite ideo if indep==1
estimates store Indep
coefplot All GOP Indep, drop(_cons dem gop age nonwhite) xline(0)  title("Linear model", size(small)) xtitle("Marginal effects", size(small)) scheme(plotplain) levels(95 90)
graph save "Graph" "plot_policyOLS.gph", replace
graph combine "plot_policyOLS.gph" "plot_policylogits.gph", note("Bars show 90% and 95% confidence intervals", size(vsmall))
graph save "Graph" "plot_policy_combine.gph"

**Section 5.2 (Procedural fairness)

*bivariate significance

ttest fairness, by(specific)
ttest fairness if dem==1, by(specific)
ttest fairness if gop==1, by(specific)
ttest fairness if indep==1, by(specific)

prtest fairness_dum, by(specific)
prtest fairness_dum if dem==1, by(specific)
prtest fairness_dum if gop==1, by(specific)
prtest fairness_dum if indep==1, by(specific)


*Figure 7

cibar fairness, over(specific) graphopts(scheme(plotplain) title("All Respondents", size(small)) ytitle("Mean Fairness", size(small)) yscale(range(2.2 3.2)) ylabel(2.2(0.2)3.2)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "fair_cibar.gph"
cibar fairness if dem==1, over(specific) graphopts(scheme(plotplain) title("Democrats", size(small)) ytitle("Mean Fairness", size(small)) yscale(range(2.2 3.2)) ylabel(2.2(0.2)3.2)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "fairD_cibar.gph"
cibar fairness if gop==1, over(specific) graphopts(scheme(plotplain) title("Republicans", size(small)) ytitle("Mean Fairness", size(small)) yscale(range(2.2 3.2)) ylabel(2.2(0.2)3.2)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "fairR_cibar.gph"
cibar fairness if indep==1, over(specific) graphopts(scheme(plotplain) title("Independents", size(small)) ytitle("Mean Fairness", size(small)) yscale(range(2.2 3.2)) ylabel(2.2(0.2)3.2)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "fairI_cibar.gph"
grc1leg "fair_cibar.gph" "fairD_cibar.gph" "fairR_cibar.gph" "fairI_cibar.gph", scheme(plotplain) note("95% confidence intervals", size(vsmall))
graph save "Graph" "fair_cibar_combine.gph"

*Figure 8

cibar fairness_dum, over(specific) graphopts(scheme(plotplain) title("All Respondents", size(small)) ytitle("Proportion Fair", size(small)) yscale(range(.3 .9)) ylabel(.3(.1).9)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "fairdum_cibar.gph"
cibar fairness_dum if dem==1, over(specific) graphopts(scheme(plotplain) title("Democrats", size(small)) ytitle("Proportion Fair", size(small)) yscale(range(.3 .9)) ylabel(.3(.1).9)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "fairdumD_cibar.gph"
cibar fairness_dum if gop==1, over(specific) graphopts(scheme(plotplain) title("Republicans", size(small)) ytitle("Proportion Fair", size(small)) yscale(range(.3 .9)) ylabel(.3(.1).9)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "fairdumR_cibar.gph"
cibar fairness_dum if indep==1, over(specific) graphopts(scheme(plotplain) title("Independents", size(small)) ytitle("Proportion Fair", size(small)) yscale(range(.3 .9)) ylabel(.3(.1).9)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "fairdumI_cibar.gph"
grc1leg "fairdum_cibar.gph" "fairdumD_cibar.gph" "fairdumR_cibar.gph" "fairdumI_cibar.gph", scheme(plotplain) note("95% confidence intervals", size(vsmall))
graph save "Graph" "fairdum_cibar_combine.gph"

*Table 4

regress fairness specific dem gop age polint_wdk posths female nonwhite ideo
regress fairness specific age polint_wdk posths female nonwhite ideo if dem==1
regress fairness specific age polint_wdk posths female nonwhite ideo if indep==1

logit fairness_dum specific dem gop age polint_wdk posths female nonwhite ideo
logit fairness_dum specific age polint_wdk posths female nonwhite ideo if dem==1
logit fairness_dum specific age polint_wdk posths female nonwhite ideo if indep==1

logit fairness_dum specific dem gop age polint_wdk posths female nonwhite ideo
margins, at(specific=0 age=54 polint_wdk=3 posths=1 female=1 nonwhite=0 ideo=3)
margins, at(specific=1 age=54 polint_wdk=3 posths=1 female=1 nonwhite=0 ideo=3)
logit fairness_dum specific age polint_wdk posths female nonwhite ideo if dem==1
margins, at(specific=0 age=53 polint_wdk=4 posths=1 female=1 nonwhite=0 ideo=2)
margins, at(specific=1 age=53 polint_wdk=4 posths=1 female=1 nonwhite=0 ideo=2)

*Figure 9

label variable posths "Post HS"
label variable polint_wdk "Political interest"
label variable ideo "Ideology"
logit fairness_dum specific dem gop age polint_wdk posths female nonwhite ideo
margins, dydx(*) post
estimates store All
logit fairness_dum specific age polint_wdk posths female nonwhite ideo if dem==1
margins, dydx(*) post
estimates store Dem
logit fairness_dum specific age polint_wdk posths female nonwhite ideo if indep==1
margins, dydx(*) post
estimates store Indep
coefplot All Dem Indep, drop(_cons dem gop age nonwhite) xline(0) title("Logit model", size(small)) xtitle("Marginal change in prob.", size(small)) scheme(plotplain) levels(95 90)
graph save "Graph" "plot_fairnesslogits.gph"

regress fairness specific dem gop age polint_wdk posths female nonwhite ideo
estimates store All
regress fairness specific age polint_wdk posths female nonwhite ideo if dem==1
estimates store Dem
regress fairness specific age polint_wdk posths female nonwhite ideo if indep==1
estimates store Indep
coefplot All Dem Indep, drop(_cons dem gop age nonwhite) xline(0) title("Linear model", size(small)) xtitle("Marginal effects", size(small)) scheme(plotplain) levels(95 90)
graph save "Graph" "plot_fairnessOLS.gph"
graph combine "plot_fairnessOLS.gph" "plot_fairnesslogits.gph", note("Bars show 90% and 95% confidence intervals", size(vsmall))
graph save "Graph" "plot_fairness_combine.gph"

***Online Appendix survey analysis

**Figure A2

catcibar policyapp, over(treat) proportion scheme(plotplain) cilevel(95) title("All Respondents", size(small)) ytitle("Percentage Approving", size(small)) colors(gs3 gs8 gs13) xlabel(,labsize(vsmall))
graph save Graph "policyappRR_cat.gph", replace
catcibar policyapp if dem==1, over(treat) proportion scheme(plotplain) cilevel(95) title("Democrats", size(small)) ytitle("Percentage Approving", size(small)) colors(gs3 gs8 gs13) xlabel(,labsize(vsmall))
graph save Graph "policyappRR_catD.gph", replace
catcibar policyapp if gop==1, over(treat) proportion scheme(plotplain) cilevel(95)  title("Republicans", size(small)) ytitle("Percentage Approving", size(small)) colors(gs3 gs8 gs13) xlabel(,labsize(vsmall))
graph save Graph "policyappRR_catR.gph", replace
catcibar policyapp if indep==1, over(treat) proportion scheme(plotplain) cilevel(95) title("Independents", size(small)) ytitle("Percentage Approving", size(small)) colors(gs3 gs8 gs13) xlabel(,labsize(vsmall))
graph save Graph "policyappRR_catI.gph", replace
grc1leg "policyappRR_cat.gph" "policyappRR_catD.gph" "policyappRR_catR.gph" "policyappRR_catI.gph", scheme(plotplain)
*use graph editor to shrink text size of legend box
graph save "Graph" "policyappRR_cat_combine.gph", replace


**Figure A3

catcibar fairness, over(treat) proportion scheme(plotplain) cilevel(95) title("All Respondents", size(small)) ytitle("Percentage Approving", size(small)) colors(gs3 gs8) xlabel(,labsize(vsmall))
graph save Graph "fairRR_cat.gph", replace
catcibar fairness if dem==1, over(treat) proportion scheme(plotplain) cilevel(95) title("Democrats", size(small)) ytitle("Percentage Approving", size(small)) colors(gs3 gs8) xlabel(,labsize(vsmall))
graph save Graph "fairRR_catD.gph", replace
catcibar fairness if gop==1, over(treat) proportion scheme(plotplain) cilevel(95) title("Republicans", size(small)) ytitle("Percentage Approving", size(small)) colors(gs3 gs8) xlabel(,labsize(vsmall))
graph save Graph "fairRR_catR.gph", replace
catcibar fairness if indep==1, over(treat) proportion scheme(plotplain) cilevel(95) title("Independents", size(small)) ytitle("Percentage Approving", size(small)) colors(gs3 gs8) xlabel(,labsize(vsmall))
graph save Graph "fairRR_catI.gph", replace
grc1leg "fairRR_cat.gph" "fairRR_catD.gph" "fairRR_catR.gph" "fairRR_catI.gph", scheme(plotplain)
*use graph editor to shrink text size of legend box
graph save "Graph" "fairRR_cat_combine.gph", replace

**Table A5

regress congapp4 general specific dem gop age polint_wdk posths female nonwhite ideo
regress congapp4 general specific age polint_wdk posths female nonwhite ideo if dem==1
regress congapp4 general specific age polint_wdk posths female nonwhite ideo if indep==1
logit congapp_dum general specific dem gop age polint_wdk posths female nonwhite ideo
logit congapp_dum general specific age polint_wdk posths female nonwhite ideo if dem==1
logit congapp_dum general specific age polint_wdk posths female nonwhite ideo if indep==1

*Figure A4

cibar congapp4, over(treat) graphopts(scheme(plotplain) title("All Respondents", size(small)) ytitle("Mean Approval", size(small)) yscale(range(1 3)) ylabel(1(0.2)3)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "congapp_cibar.gph", replace
cibar congapp4 if dem==1, over(treat) graphopts(scheme(plotplain) title("Democrats", size(small)) ytitle("Mean Approval", size(small)) yscale(range(1 3)) ylabel(1(0.2)3)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "congappD_cibar.gph", replace
cibar congapp4 if gop==1, over(treat) graphopts(scheme(plotplain) title("Republicans", size(small)) ytitle("Mean Approval", size(small)) yscale(range(1 3)) ylabel(1(0.2)3)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "congappR_cibar.gph", replace
cibar congapp4 if indep==1, over(treat) graphopts(scheme(plotplain) title("Independents", size(small)) ytitle("Mean Approval", size(small)) yscale(range(1 3)) ylabel(1(0.2)3)) ciopts(lcolor(gs1)) barcolor(gs6 gs10 gs14) bargap(10) level(95)
graph save Graph "congappI_cibar.gph", replace
grc1leg "congapp_cibar.gph" "congappD_cibar.gph" "congappR_cibar.gph" "congappI_cibar.gph", scheme(plotplain) note("95% confidence intervals", size(vsmall))
graph save "Graph" "congapp_cibar_combine.gph"


*Figure A5

cibar respGOP, over(specific) graphopts(scheme(plotplain) title("All Respondents", size(small)) ytitle("Proportion Blaming GOP", size(small)) yscale(range(.1 .8)) ylabel(.1(.1).8)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "respGOP_cibar.gph"
cibar respGOP if dem==1, over(specific) graphopts(scheme(plotplain) title("Democrats", size(small)) ytitle("Proportion Blaming GOP", size(small)) yscale(range(.1 .8)) ylabel(.1(.1).8)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "respGOPD_cibar.gph"
cibar respGOP if gop==1, over(specific) graphopts(scheme(plotplain) title("Republicans", size(small)) ytitle("Proportion Blaming GOP", size(small)) yscale(range(.1 .8)) ylabel(.1(.1).8)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "respGOPR_cibar.gph"
cibar respGOP if indep==1, over(specific) graphopts(scheme(plotplain) title("Independents", size(small)) ytitle("Proportion Blaming GOP", size(small)) yscale(range(.1 .8)) ylabel(.1(.1).8)) ciopts(lcolor(gs1)) barcolor(gs8 gs13) bargap(10) level(95)
graph save Graph "respGOPI_cibar.gph"
grc1leg "respGOP_cibar.gph" "respGOPD_cibar.gph" "respGOPR_cibar.gph" "respGOPI_cibar.gph", scheme(plotplain) note("95% confidence intervals", size(vsmall))
graph save "Graph" "respGOP_cibar_combine.gph"

*Table A6

logit respGOP specific dem gop age polint_wdk posths female nonwhite ideo
logit respGOP specific age polint_wdk posths female nonwhite ideo if dem==1
logit respGOP specific age polint_wdk posths female nonwhite ideo if indep==1


